class PSGFXDamage extends GFxMoviePlayer;

var GFxObject mc, vign, blood1,blood2,blood3, impact; // movie controllers

var int hits;       // hit counter
var float lastHit;  // Time from last hit

var bool bPlaying, bVign, bBlood1, bBlood2, bBlood3; // controls visible efects
var int frameVign, frameBlood1, frameBlood2, frameBlood3;

function bool Start(optional bool StartPaused = false)
{
    super.Start();
    Advance(0);

	mc = GetVariableObject("_root");
	vign = GetVariableObject("clpVign");
	impact = GetVariableObject("clpImacto");
	blood1 = GetVariableObject("clpBlood1");
	blood2 = GetVariableObject("clpBlood2");
	blood3 = GetVariableObject("clpBlood3");

	vign.GotoAndStop("end");
	impact.GotoAndStop("end");
	blood1.GotoAndStop("end");
	blood2.GotoAndStop("end");
	blood3.GotoAndStop("end");
	
	hits = 0;
	lastHit = 0.0;

	bVign = false;
	bBlood1 = false;
	bBlood2 = false;
	bBlood3 = false;

	return true;
}

function gotoAndStop(int object, int frame)
{
	switch(object)
	{
		case(0):
			vign.GotoAndStopI(frame);
			frameVign = frame;
			bVign = true;
			break;

		case(1):
			blood1.GotoAndStopI(frame);
			frameBlood1 = frame;
			bBlood1 = true;
			break;
		
		case(2):
			blood2.GotoAndStopI(frame);
			frameBlood2 = frame;
			bBlood2 = true;
			break;
		
		case(3):
			blood3.GotoAndStopI(frame);
			frameBlood3 = frame;
			bBlood3 = true;
			break;
		
	}
}

function playImpact()
{
	impact.GotoAndPlay("start");
}


function playFadeOut()
{
	if(bVign) vign.GotoAndPlayI(frameVign);
	if(bBlood1) blood1.GotoAndPlayI(frameBlood1);
	if(bBlood2) blood2.GotoAndPlayI(frameBlood2);
	if(bBlood3) blood3.GotoAndPlayI(frameBlood3);
}


/* -------------- diapear layers ----------------- */
function EndVignette()
{
	frameVign = -1;
	bVign = false;
}

function EndBlood1()
{
	frameBlood1 = -1;
	bBlood1 = false;
}

function EndBlood2()
{
	frameBlood2 = -1;
	bBlood2 = false;
}

function EndBlood3()
{
	frameBlood3 = -1;
	bBlood3 = false;
}



DefaultProperties
{
	bEnableGammaCorrection=FALSE
	bPauseGameWhileActive=false
	bCaptureInput=false
	MovieInfo = SwfMovie'PS_Flash_Damage.ps_damage'
}
